/* Event handler that check is required field in new row
 filled. If is trigger insert new row event */

function checkNewLine(e) {
    fieldName = e.target.name;
    trig = true;

    if (eval('typeof(dzNewFld_'+fieldName+')') != 'undefined') {
        reqFields = eval('dzNewFld_'+fieldName);
        rfCount = reqFields.length;
        if (rfCount > 0) {
            /* Check required fields */
            for (c = 0; c < rfCount; c++) {
                s = eval('document.NalleForm.'+reqFields[c]+'.value');
                if (s.length == 0)
                    trig = false;
            }
        } else {
            s = eval('document.NalleForm.'+fieldName+'.value')
            if (s.length == 0)
                    trig = false;
        }
    } else
        trig = false;
    /* This must be set as time out to get the OnFocus event to occur
       before submit */
    if (trig)
        setTimeout('submitNalle("nalle", fieldName, "ENewLine", LastFocused);', 100);
}

